/*  File Name	: SvcHandler.h
 *  Author		: Pang Jiacai
 *	 E-mail		: 823960168@qq.com
 *  Created on	: 2012-4-25
 *  Description:
 */

#ifndef SVCHANDLER_H_
#define SVCHANDLER_H_
//#include "Task.h"
#include "Reactor.h"
#include "SockStream.h"

class SvcHandler:virtual public EventHandler
{
public:
	SvcHandler(Reactor *reactor=NULL);

	virtual ~SvcHandler();

	virtual int open (Reactor *reac);

	virtual int close(ulong flags = 0);

	virtual void set_handle (int handle);

	virtual int get_handle (void) const;

	virtual int handle_input(int handle);

	virtual int handle_close (int handle = INVALID_HANDLER,
			ReactorMask mask = EventHandler::ALL_MASK);

	virtual SockStream *peer(void) ;

private:
	SockStream peer_;
	bool is_closing_;
};

#endif /* SVCHANDLER_H_ */
